#include <stdio.h>
#include <string.h>

#define TS_PACKET_LENGTH 188

/// class TsPacket - 
class TsPacket {
  // Attributes

public:
  char sync_byte[2];
  char * buffer;
  int length;
  // Operations
public:
  static int demuxTS (char * stream, int length, TsPacket ** ts_packet_array, int & ts_nbr);
  /*constructor
   * parse the Tspacket*/
  TsPacket (char * buffer, int length);
  bool isTsPacket();
  char getContinuityCounter();
  long long int getPCR();
  unsigned int getPID();
  int getAdaptationFieldControl();
  bool isAdaptationPresent();
  bool getPCRFlag();
  char getAdaptationFieldLength();

  bool getPayload (char * &buffer, int & length);
};

